package cn.ustb.controller;

import cn.ustb.entity.StudentGrade;
import cn.ustb.service.StudentGradeService;
import cn.ustb.serviceImpl.StudentGradeServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @author yuyan
 */
@WebServlet("/grade.do")
public class StudentGradeServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获得教师信息，转换到显示页面显示教师信息
        StudentGradeService studentGradeService=new StudentGradeServiceImpl();
        List<StudentGrade> studentGrades=studentGradeService.getAll();
        request.setAttribute("studentGrades", studentGrades);
        request.getRequestDispatcher("/grade.jsp").forward(request, response);
    }
}
